using HtERP.Data;

namespace HtERP.Services
{
    /// <summary>
    /// 文件上传服务接口
    /// </summary>
    public interface IFileUploadService
    {
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <param name="request">上传请求信息</param>
        /// <returns>上传状态</returns>
        Task<UploadStatus> UploadFileAsync(string filePath, UploadRequest request);

        /// <summary>
        /// 上传文件（分块上传）
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <param name="request">上传请求信息</param>
        /// <param name="chunkSize">分块大小</param>
        /// <returns>上传状态</returns>
        Task<UploadStatus> UploadFileInChunksAsync(string filePath, UploadRequest request, long chunkSize = 4 * 1024 * 1024);

        /// <summary>
        /// 取消上传
        /// </summary>
        /// <param name="fileId">文件ID</param>
        void CancelUpload(string fileId);

        /// <summary>
        /// 检查服务器连接
        /// </summary>
        /// <returns>连接是否成功</returns>
        Task<bool> CheckServerConnectionAsync();

        /// <summary>
        /// 设置认证令牌
        /// </summary>
        /// <param name="token">认证令牌</param>
        void SetAuthToken(string token);
    }
}